﻿<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    
<div id="app" v-cloak>   
        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline" style="margin-bottom: 15px;"  label-width="100px" size="mini">
            <!--此处为查询项 循环所有字段，一行四个，不够 补空列-->
            <el-row>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
                    <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  下同-->
                    <el-form-item :label="user.loginName+mark.m">
                        <el-input v-model="formInline.model.loginName" :placeholder="user.loginName">
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
                    <el-form-item :label="user.sex+mark.m">
                        <el-input v-model="formInline.model.sex" :placeholder="user.sex">
                        </el-input>
                    </el-form-item>

                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">

                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">

                </el-col>
            </el-row>

            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmit">{{col.btnSelect}}</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="OpenInput('tj')">{{col.btnAdd}}</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onDelete">{{col.btnDelete}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

        <el-table ref="table" :data="ListItem.tableData" :row-key="getRowKeys"
                  :height="ListItem.tableHeight"
                  border @selection-change="handleSelectionChange" row-style="height:10px"
                  style="width: 100%;">
            <el-table-column type="selection" style="
    padding-top: 0px;
    padding-bottom: 0px;
" align="center" width="55" :reserve-selection="true">
            </el-table-column>
            <!-- 此处为第一列，需特殊处理成 跳转 -->
            <el-table-column prop="lastUpdate"
                             :label="user.lastUpdate">
                <template slot-scope="scope">
                    <p style="color:blue" @click=OpenInput('xg',scope.row.id)>
                        {{scope.row.lastUpdate}}
                    </p>
                </template>
            </el-table-column>
            <!-- 除第一列以外 遍历所有字段 -->
            <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  下同-->
            <el-table-column prop="loginName"
                             :label="user.loginName">
            </el-table-column>
            <el-table-column prop="sex"
                             :label="user.sex">
            </el-table-column>
            <el-table-column prop="remarks"
                             :label="user.remarks">
            </el-table-column>
        </el-table>
        <el-row type="flex" justify="end">

            <el-pagination ref="page" @size-change="handleSizeChange"
                           @current-change="handleCurrentChange"
                           :current-page="ListItem.currentPage"
                           :page-sizes="ListItem.pagesizes"
                           :page-size="ListItem.pagesize"
                           :layout="ListItem.layout"
                           :total="ListItem.total">
            </el-pagination>

        </el-row>
        <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  -->
        <el-dialog :title="user.TableName" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%" top="0vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:280px;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                ListItem: ListItem,
                formInline: {
                    // 遍历所有列 均为字符串即可
                    model: { loginName: '', sex: '' },
                    offset: 0,
                    limit: 10
                }
            },
            mounted: function () {
                this.GetPageData(1);
                tablehigh(this);
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                closeDialog: function () { closeDialog(this); },
                //Model 替换成 表名
                onDelete: function () { onDelete(this, '/api/Model/DeleteMuti'); },

                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Model 替换成 表名
                OpenInput: function (val, id) { DialogShow(this, val, "ModelInput.html", id); },
                //Model 替换成 表名
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/Model/GetList') },
  
                onSubmit: function () { onSubmit(this); },

                handleSizeChange: function (val) { handleSizeChange(this, val); },

                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
            }
        });
    </script>
</body>
</html>